home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 13.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-08-07  |  4.7 KB  |  239 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. CompTotal = strip(line)
  30. do i = 1 to CompTotal
  31.     line = readln(TempFile)
  32.     PicName.i = strip(line)
  33.     line = readln(TempFile)
  34.     Start.i = strip(line)
  35.     line = readln(TempFile)
  36.     End.i = strip(line)
  37.     line = readln(TempFile)
  38.     IAType.i = strip(line)
  39.     line = readln(TempFile)
  40.     BlendNum.i = strip(line)
  41.     line = readln(TempFile)
  42.     InType.i = strip(line)
  43.     line = readln(TempFile)
  44.     OutType.i = strip(line)
  45.     line = readln(TempFile)
  46.     FadeIn.i = strip(line)
  47.     line = readln(TempFile)
  48.     FadeOut.i = strip(line)
  49.     line = readln(TempFile)
  50.     FeatherNum.i = strip(line)
  51.     line = readln(TempFile)
  52.     DrawType.i = strip(line)
  53.     line = readln(TempFile)
  54.     DrawAnswer.i = strip(line)
  55.     end
  56. call close TempFile
  57.  
  58. Frames = (End - Start)+1
  59. j=0
  60. k=0
  61. TFrames = Frames
  62. TNum = 3
  63. if TFrames > 999 then TNum = 4
  64. if TFrames > 9999 then TNum = 5
  65. if Field = 1 then TFrames = Frames*2
  66. do i = Start to End
  67.     k = k+ 1
  68.     call open TempFile,"RAM:VFXNums",W
  69.     call writeln TempFile,right(k,5,'0')
  70.     call writeln TempFile,right(Frames,5,'0')
  71.     call close TempFile
  72.     f=0
  73.     Redraw Off
  74.     j = j+ 1
  75.     FieldSet = 0
  76.     call DoIt()
  77.     Redraw On
  78.     call SaveIt()
  79.         if Field = 1 then do
  80.             Redraw Off
  81.             j = j + 1
  82.             FieldSet = 1
  83.             call DoIt()
  84.             Redraw On
  85.             call SaveIt()
  86.             end 
  87.     end
  88.     Undo On
  89. exit
  90.  
  91.  
  92.  
  93. LoadA:
  94.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  95.         Undo On
  96.         exit
  97.         end
  98.     if IAType = 0 then do
  99.         LoadBuffer PicAName Force i
  100.         end
  101.     if IAType = 1 then do
  102.         LoadBuffer PicAName Force 1
  103.         end
  104.     if IAType = 2 then do
  105.         LoadBuffer PicAName Force
  106.         end
  107.     if IAType = 3 then do
  108.         LoadBuffer PicAName""right(i,TNum,'0') Force
  109.         end
  110. return
  111.  
  112.  
  113. LoadAll:
  114.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  115.         Undo On
  116.         exit
  117.         end
  118.     if IAType.all = 0 then do
  119.         LoadBuffer PicName.all Force (k+Start.all)-1
  120.         end
  121.     if IAType.all = 1 then do
  122.         LoadBuffer PicName.all Force 1
  123.         end
  124.     if IAType.all = 2 then do
  125.         LoadBuffer PicName.all Force
  126.         end
  127.     if IAType.all = 3 then do
  128.         LoadBuffer PicName.all""right((k+Start.all)-1,TNum,'0') Force
  129.         end
  130. return
  131.  
  132.  
  133. SaveIt:
  134.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  135.         Undo On
  136.         exit
  137.         end
  138.     if SaveType = 0 then do
  139.         call Switcher(TOSW)
  140.         call Switcher(MDV1)
  141.  
  142.         Render Go
  143.         if Field = 1 then
  144.                 call RecordAdd(SaveName,1,6,Compression)
  145.         else
  146.                 call RecordAdd(SaveName,2,6,Compression)
  147.         if j = TFrames then
  148.             call MakeIcon(SaveName,(Frames-10))
  149.         end
  150.  
  151.     if SaveType = 1 then do
  152.         if Field = 1 then do
  153.             f= f + 1
  154.             if f = 1 then
  155.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  156.             if f = 2 then do
  157.                 GetMain
  158.                 parse var result Name Width Height Blah
  159.                 Scale Width Height/2
  160.                 Swap
  161.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  162.                 Scale Width Height/2
  163.                 Hook Interlace
  164.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  165.                 f = 0
  166.                 end
  167.             end
  168.         else do
  169.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  170.             end    
  171.         end
  172.  
  173. return
  174.  
  175.  
  176.  
  177. GetFilled:
  178.     PathFile = "VFXIFX:TempDrawer/DrawNum."FXNum"."right(all,2,'0')
  179.     call open TempFile,PathFile,R
  180.     NewArea
  181.     do until eof(TempFile)
  182.         line = readln(TempFile)
  183.         AddArea line
  184.         end
  185.     FilledFree
  186.     call close TempFile
  187. return
  188.  
  189. DoIt:
  190.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  191.         Undo On
  192.         exit
  193.         end
  194.  
  195.     DrawStyle Normal
  196.     Blend 100
  197.     call LoadA()
  198.     DrawStyle RubThrough
  199.     GetMain
  200.     parse var result Name Width Height Blah
  201.     if j = 1 then do
  202.         do all = 1 to CompTotal
  203.             aa.all = 0
  204.             end
  205.         end
  206.     do all = 1 to CompTotal
  207.         Swap
  208.         call LoadAll()
  209.         Swap
  210.         FadeNum = BlendNum.all
  211.         if FadeIn.all > 0 & j <= FadeIn.all then do
  212.             FadeNum = trunc(((j-1) * BlendNum.all) / (FadeIn.all-1))
  213.             if FadeNum > BlendNum.all then FadeNum = BlendNum.all
  214.             end
  215.         if FadeOut.all > 0 & j >= (TFrames-FadeOut.all) then do
  216.             aa.all = aa.all +1
  217.             FadeNum = trunc(BlendNum.all-((aa.all-1) * BlendNum.all) / (FadeOut.all-1))
  218.             if FadeNum > BlendNum.all then FadeNum = BlendNum.all
  219.             end
  220.         Blend FadeNum
  221.  
  222.         EdgeMode Normal
  223.         if FeatherNum.all > 0 then EdgeMode FeatherOut FeatherNum.all
  224.         
  225.  
  226.         if DrawType.all = 0 then FilledBox DrawAnswer.all
  227.         if DrawType.all = 1 then FilledOval DrawAnswer.all
  228.         if DrawType.all = 2 then call GetFilled()
  229.         if DrawType.all = 3 then call GetFilled()
  230.         EdgeMode Normal
  231.         end
  232.  
  233.     DrawStyle Normal
  234.     Blend 100
  235.  
  236. return
  237.  
  238.  
  239.